package com.jlpay.openapi.demo.openmerch.register;

import com.jlpay.open.jlpay.sdk.java.model.openmerch.register.request.IncomingQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.register.response.IncomingQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author chenjunhong
 * @since 2024/3/25
 */
public class IncomingQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(IncomingQueryService.class);

    public static void main(String[] args) {
        IncomingQueryRequest incomingQueryRequest = buildIncomingQueryRequest();
        IncomingQueryResponse incomingQueryResponse = JlpayOpenApiService.openMerchService()
                .post(incomingQueryRequest, IncomingQueryResponse.class);
        LOGGER.info("查询进件响应:{}", JsonUtils.toString(incomingQueryResponse));
    }

    private static IncomingQueryRequest buildIncomingQueryRequest() {
        IncomingQueryRequest incomingQueryRequest = new IncomingQueryRequest();
        // 申请单号
        incomingQueryRequest.setApplyId("ce0b904ec54d46ff8279b387ed4b9cca");
        return incomingQueryRequest;
    }

}
